<template>
  <div class="product-list" 
 >
    <router-link :to="isSt === 'isSt' ? {name:'StDetails',params:{id:item}} : {}" class="list-item" v-for="item in productData" :key="item.id">
      <div class="img">
        <img :src="item.url" alt="" />
      </div>
      <div class="info">
        <p class="pro-title">{{ item.title }}</p>
        <p class="desc">{{ item.desc }}</p>
        <!-- 插槽 -->
        <p class="price" v-if="item.price">{{ item.price }}元/月</p>
      </div>
    </router-link>
  </div>
</template>

<script>
import api from '../api';
export default {
  name: "Product",
  props: {
    productData: {
      type: Array,
      defalut: [],
    },
    isHm:{
      type:String,
      defalut:''
    },
    isSt:{
      type:String,
      defalut:''
    },
  },
 
};
</script>

<style lang="less" scoped>
// 产品
.product-list {
  width: 100%;
  .list-item {
    height: 111px;
    border: 1px solid #eee;
    padding: 11.5px 11px;
    box-sizing: border-box;
    display: flex;
    .img {
      width: 126px;
      height: 85px;
      margin-right: 11px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .info {
      width: 200px;
      .pro-title {
        width: 196px;
        height: 23px;
        line-height: 20px;
        color: rgba(16, 16, 16, 1);
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin: 8px 0 5px;
      }
      .desc {
        // width: 200px;
        height: 34px;
        line-height: 17px;
        color: rgba(153, 153, 153, 1);
        font-size: 12px;
        display: -webkit-box;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }
    }
  }
}
.price {
  width: 72px;
  height: 23px;
  line-height: 20px;
  color: rgba(255, 68, 68, 1);
  font-size: 14px;
  text-align: center;
  margin-top: 5px;
}
</style>